KEYS * blocks the event loop for the entire scan — catastrophic on large keyspaces. Use SCAN cursor COUNT hint MATCH pattern for non-blocking incremental iteration. For set membership patterns, use secondary index structures (sets per category) instead of key pattern scans.